package com.hhxy.date;

import java.lang.reflect.Array;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;

public class Test1 {
    public static void main(String[] args) throws ParseException {
        int[] arr ={2,1,3,6,2,8,9};
        int[] arr1 = {9,8,7,6,5,4,3,2,1};
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
        System.out.println(Arrays.toString(arr1));
        Integer[] a = {1,2,3,4,5,6,7,8};
        Arrays.sort(a, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1-o2;
            }
        });
        System.out.println(Arrays.binarySearch(arr, 4));
        System.out.println(Arrays.binarySearch(arr1, 2));
    }
}
